package com.fduss.mazegame;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.fduss.mazegame.client.aui.GameViewActivity;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button startGame = (Button)findViewById(R.id.startGame);
        Button help = (Button)findViewById(R.id.helpButton);
        final EditText rowNum = (EditText)findViewById(R.id.rowNum);
        final EditText colNum = (EditText)findViewById(R.id.colNum);

        startGame.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, GameViewActivity.class);
                intent.putExtra("rowNum", rowNum.getText().toString());
                intent.putExtra("colNum", colNum.getText().toString());
                startActivity(intent);
            }
        });
        help.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            showHelpMessage();
            }
        });
    }

    private void showHelpMessage() {
        String mess = getString(R.string.help_message);
        Toast.makeText(this, mess, Toast.LENGTH_LONG).show();
    }
}
